<?php

/*

Autore: Urza
Email: sbozzolator@gmail.com	
Data: 3/10/09
Versione: 1.0 (Release)
Nome: DisplayFunctions.php

*/

function ReadFromFile($filename) {
	$content = @file_get_contents ($filename);
	return $content;
}

function SaveToFile ($filename, $content) {
	$content = @file_put_contents ($filename, $content);
}

function parsetemplate ($template, $array) {
	return preg_replace('#\{([a-z0-9\-_]*?)\}#Ssie', '( ( isset($array[\'\1\']) ) ? $array[\'\1\'] : \'\' );', $template);
}

function gettemplate ($templatename) {
	global $Root;

	$filename = $Root . TEMPLATE_DIR '/' . $templatename . ".tpl";

	return ReadFromFile($filename);
}

?>